@model IEnumerable<ExpertSMS.Models.BillOfLadingProduct>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Quantity
        </th>
        <th>
            Cost
        </th>
        <th>
            BillOfLading
        </th>
        <th>
            Product
        </th>
        <th>
            Unit
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.BillOfLadingProductID }) |
            @Html.ActionLink("Details", "Details", new { id=item.BillOfLadingProductID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.BillOfLadingProductID })
        </td>
        <td>
			@String.Format("{0:F}", item.Quantity)
        </td>
        <td>
			@String.Format("{0:F}", item.Cost)
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.BillOfLading).ToString()
        </td>
        <td>
			@(item.Product == null ? "None" : item.Product.Name)
        </td>
        <td>
			@(item.Unit == null ? "None" : item.Unit.Name)
        </td>
    </tr>
}

</table>


